<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>删除会员地址api、JavsShop标签、API使用手册</title>
<link href="../../stylecss.css" rel="stylesheet" type="text/css" />
</head>

<body>
<!--头部-->
<div id="header">
		<div class="header_top">
		<h1><em>JavsShop</em>文档</h1>
		<div class="title_line">
			<a href="/docs/template_help.html">模板制作手册</a>
			<a href="/docs/api/index.html">API文档</a>
			<a href="/docs/tags/index.html">标签文档</a>
		</div>
	</div>
</div>
<script src="${staticserver}/js/common/jquery-1.8.3.min.js"></script>
<script src="${staticserver}/js/common/jquery-form-2.33.js"></script>
<div id="outside">
	<div class="premise">
		<input type="button" value="登录" name="button" id="login"></input>
		<input type="button" value="注销登录" id="logout"></input>
	</div>
<#assign regionSelect = "com.enation.app.shop.core.tag.regions.RegionSelectDirective"?new()>
<form id="addrForm" method="post" action="/api/shop/memberAddress!delete.do">
			<h1>请输入要删除的收货地址ID:(如：addr_id=1，那么就在下面的输入框中输入"1",即可。不带"")</h1>
			<div class="premise">
				<input type="text" id="addressid" autocomplete="off" value="" name="addr_id" isrequired="true" class="addressid"></input>
				<input type="button" id="btnDelete" value="删除一个收货地址" class="userDelete">
			</div>
			</form>		
<div id="show">		
<h1>输出结果</h1>	
<textarea  id="frm" >

</textarea>
</div>
</div>
	<#include '/docs/fooder.html' />

<script>
	$(function(){
		var DeleteAction ="/api/shop/memberAddress!delete.do";           //只需要把必须填写的参数写到form中，例如name="addr_id"，“name”后面是参数，提交后会自动在from中寻找必填项目。而不用在jq中写死，因为这里也是不能写死的。更不用delete.do?XXXX=$("#XXX").val().这样写服务器好像不认。
		$("#btnDelete").click(function(del){
		
					$("#addrForm").ajaxSubmit({
				url:DeleteAction,
				type:"post",
				dataType:"html",
		 
				success:function(result){
					 $("#frm").val(result)
					 
				 
				},
				error:function(e){
					alert("操作失败！");
				}
			});
			
		})
	})
</script>
<script type="text/javascript">
<!--
$(function(){
 
		var addAction = "${ctx}/api/shop/memberAddress!add.do";
		$("#btnSubmit").click(function(){
			$("#addrForm").ajaxSubmit({
				url:addAction,
				type:"post",
				dataType:"html",
		 
				success:function(result){
					 $("#frm").val(result)
					 alert("ok")
				 
				},
				error:function(e){
					alert("操作失败！");
				}
			});
		});
	
})
//-->
</script>	
<!--会员登录-->

<script>
$(function(){
	$("#login").click(function(){
		var apiurl="/api/shop/member!login.do?username=18611138651&password=123456";
		$.ajax({
			url:"${ctx}"+apiurl,

			dataType:"json",
			success:function(aa){
				if(aa.result==1){
					alert("恭喜登录成功")
				}
				else{
					alert("用户名和密码错误")
				}
			},
			error:function(){
				alert("api地址错误，请检查");
			}
			
		});
	});
})
</script>
<script>
$(function(){
	$("#logout").click(function(){
		var apiurl="/api/shop/member!logout.do";
		$.ajax({
			url:"${ctx}"+apiurl,

			dataType:"json",
			success:function(bb){
				if(bb.result==1){
					alert("恭喜注销成功")
				}
				else{
					alert("已经注销过了错误")
				}
			},
			error:function(){
				alert("api地址错误，请检查");
			}
			
		});
	});
})
</script>		